var reverseLeftWords = function(s, n) {
    let m = s.length,
        j=0;
    let strArr = Array.from(s)
    //console.log(strArr);
    for(let i=m;i<m+n;i++){
        strArr[i] = strArr[j++] 
    }
    //console.log(strArr);

    for(let i=0;i<m;i++){
        strArr[i]=strArr[j]
        j++
    }
    strArr.length=m
    return strArr.join('')  
};
console.log(reverseLeftWords('abcdefg',2));